home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Newton Sample Code 1.1 / Views / ViewScripts-2 / ViewScripts.text < prev    next >
Encoding:
Text File  |  1994-02-28  |  3.2 KB  |  151 lines  |  [TEXT/MPS ]

  1. // Copyright © 1993-94 Apple Computer, Inc. All rights reserved.
  2.  
  3. constant kAppName := '|ViewScript:PIEDTS|;
  4.  
  5. // ---- End Project Data ----
  6.  
  7.  
  8. // ---- File ViewScripts.t ----
  9. MainView :=
  10.    {title: "View Scripts Example",
  11.     viewBounds: {left: 0, top: 0, right: 240, bottom: 332},
  12.     viewSetupDoneScript:
  13.       func()
  14.       begin
  15.           print("mainView viewSetupDoneScript");
  16.       end,
  17.     viewSetupFormScript:
  18.       func()
  19.       begin
  20.           constant kMaxWidth := 240;
  21.           constant kMaxHeight := 336;
  22.       
  23.           local b := GetAppParams();
  24.       
  25.           self.viewBounds := RelBounds(b.appAreaLeft, b.appAreaTop,
  26.                                                   Min(b.appAreaWidth, kMaxWidth),
  27.                                                   Min(b.appAreaHeight, kMaxHeight)
  28.                                               );
  29.       
  30.           Print("mainView viewSetupFormScript");
  31.       end,
  32.     viewSetupChildrenScript:
  33.       func()
  34.       begin
  35.           print("mainView viewSetupChildrenScript");
  36.       end,
  37.     viewDrawScript:
  38.       func()
  39.       begin
  40.           print("mainView viewDrawScript");
  41.       end,
  42.     _proto: protoApp,
  43.     debug: "MainView"
  44.    };
  45.  
  46. child1 := /* child of MainView */
  47.    {viewFlags: 1,
  48.     viewFormat: 337,
  49.     viewBounds: {left: 50, top: 66, right: 186, bottom: 130},
  50.     viewSetupFormScript:
  51.       func()
  52.       begin
  53.           print("child1 viewSetupFormScript");
  54.       end,
  55.     viewSetupChildrenScript:
  56.       func()
  57.       begin
  58.           print("child1 viewSetupChildrenScript");
  59.       end,
  60.     viewSetupDoneScript:
  61.       func()
  62.       begin
  63.           print("child1 viewSetupDoneScript");
  64.       end,
  65.     viewDrawScript:
  66.       func()
  67.       begin
  68.           print("child1 viewDrawScript");
  69.       end,
  70.     viewFont: ROM_fontSystem9,
  71.     viewlinespacing: 20,
  72.     text: "child1",
  73.     viewclass: 81,
  74.     debug: "child1"
  75.    };
  76.  
  77. grandchild11 := /* child of child1 */
  78.    {viewFlags: 1,
  79.     viewFormat: 337,
  80.     viewBounds: {left: 32, top: 24, right: 104, bottom: 48},
  81.     viewSetupFormScript:
  82.       func()
  83.       begin
  84.           print("grandchild11 viewSetupFormScript");
  85.       end,
  86.     viewSetupChildrenScript:
  87.       func()
  88.       begin
  89.           print("grandchild11 viewSetupChildrenScript");
  90.       end,
  91.     viewSetupDoneScript:
  92.       func()
  93.       begin
  94.           print("grandchild11 viewSetupDoneScript");
  95.       end,
  96.     viewDrawScript:
  97.       func()
  98.       begin
  99.           print("grandchild11 viewDrawScript");
  100.       end,
  101.     viewlinespacing: 20,
  102.     viewFont: ROM_fontSystem9,
  103.     text: "grandchild11",
  104.     viewclass: 81,
  105.     debug: "grandchild11"
  106.    };
  107.  
  108.  
  109.  
  110.  
  111.  
  112. child2 := /* child of MainView */
  113.    {viewFlags: 1,
  114.     viewFormat: 337,
  115.     viewBounds: {left: 50, top: 162, right: 186, bottom: 218},
  116.     viewSetupFormScript:
  117.       func()
  118.       begin
  119.           print("child2 viewSetupFormScript");
  120.       end,
  121.     viewSetupChildrenScript:
  122.       func()
  123.       begin
  124.           print("child2 viewSetupChildrenScript");
  125.       end,
  126.     viewSetupDoneScript:
  127.       func()
  128.       begin
  129.           print("child2 viewSetupDoneScript");
  130.       end,
  131.     viewDrawScript:
  132.       func()
  133.       begin
  134.           print("child2 viewDrawScript");
  135.       end,
  136.     viewlinespacing: 20,
  137.     viewFont: ROM_fontSystem9,
  138.     text: "child2",
  139.     viewclass: 81,
  140.     debug: "child2"
  141.    };
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149. // ---- Beginning of section for non used Layout files ----
  150.  
  151. // End of output